package com.imooc.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.validation.constraints.Min;

/**
 *
 * @Entity 表示与数据库表的相对应
 * Created by ancy on 2017/7/8.
 */

@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class Girl {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO) // 自动增长列 不写默认是  自动增长
    private Integer id;

    private String name;

    @Min(value = 18,message = "未成年。。。")
    private Integer age;

}
